<div class="topBar">
      <div class="topTitle">广告列表</div>
      <div class="topButton"><a href="/admin/add-ad" target="_self"><img src="/images/admin/addNew.gif"/></a></div>
    </div>
    
	<table cellspacing="0" cellpadding="0" border="0" class="listTable">
	<tbody>
	  <tr class="thead">
		<td>图片</td>
		<td>广告名称</td>
		<td>显示位置</td>
		<td>显示顺序</td>
		<td>是否生效</td>
		<td>操作</td>
	  </tr>
	  <?php
	  foreach ($this->ads as $ad){
	  	?>
	 
	  <tr>
		<td><img width="100" height="100" src='/images/advertisements/<?php echo $ad->image;?>'/></td>
		<td><a target="_self" href="/admin/edit-ad/id/<?php echo $ad->id;?>"><?php echo $ad->name;?></a></td>
		<td><?php
				switch ($ad->position){
					case 0 :
						echo "默认（艺术品页面右侧）";
						break;
					case 1 :
						echo "艺术家页面右侧";
						break;
					case 2 :
						echo "新闻页面右侧";
						break;
					default :
						break;
				}
			?></td>
		<td><?php echo $ad->display_order;?></td>
		<td><?php echo $ad->enabled ? "生效" : "失效";?></td>
		
		<td><a target="_self" href="/admin/edit-ad/id/<?php echo $ad->id;?>">编辑</a>&nbsp;&nbsp;&nbsp;&nbsp;<a target="_self" href="/admin/delete-ad/id/<?php echo $ad->id;?>">删除</a></td>
	  </tr>
	  <?php
	   }
	  ?>
	</tbody>
	</table>